﻿namespace WebDevUtilities.Common
{
    using System.IO;
    using System.Linq;

    public static class Helper
    {
        public static string CorrectLineEndings(this string input)
        {
            return input.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");
        }
        
        public static void RemoveEmptyLines(this string filePath)
        {
            var lines = File.ReadAllLines(filePath).Where(arg => !string.IsNullOrWhiteSpace(arg));
            File.WriteAllLines(filePath, lines);
        }
    }
}
